<template>
  <view class="container">
    <view
      v-for="(item, index) in btnList"
      :key="index"
      class="btn-item"
      @click="click(item)"
    >
      {{ item.label }}
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      btnList: [
        {
          label: "低电量设备",
          key: "low_power",
        },
        {
          label: "零使用设备",
          key: "zero_use",
        },
        // {
        //   label: "低使用率设备",
        //   key: "low_use",
        // },
        {
          label: "待巡检设备",
          key: "special_inspection",
        },
        {
          label: "没有位置的设备",
          key: "no_location",
        },
      ],
    };
  },

  /**
   * 生命周期函数--监听页面加载
   */
  async onLoad(options) {},

  methods: {
    click(item) {
      switch (item.key) {
        case "low_power":
          uni.navigateTo({
            url: "/pages/adminPage/deviceService/maintenanceSubPage/lowPower",
          });

          break;
        case "zero_use":
          uni.navigateTo({
            url: "/pages/adminPage/deviceService/maintenanceSubPage/zeroUse",
          });
          break;
        case "low_use":
          uni.navigateTo({
            url: "/pages/adminPage/deviceService/maintenanceSubPage/lowUse",
          });
          break;
        case "special_inspection":
          uni.navigateTo({
            url: "/pages/adminPage/deviceService/maintenanceSubPage/special_inspection",
          });
          break;
        case "no_location":
          uni.navigateTo({
            url: "/pages/adminPage/deviceService/maintenanceSubPage/no_location",
          });
          break;

        default:
          break;
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  min-height: 100vh;
  background: #ebebeb;
  padding: 50rpx;
}

.btn-item {
  width: 668rpx;
  height: 90rpx;
  line-height: 40rpx;
  border-radius: 8rpx;
  background-color: rgba(13, 199, 54, 1);
  color: rgba(255, 255, 255, 1);
  font-size: 28rpx;
  text-align: center;
  font-family: PingFangSC-regular;

  margin-bottom: 30rpx;

  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
